package com.xd.core.mission.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xd.common.base.PageQuery;
import com.xd.common.util.SecurityUtil;
import com.xd.core.mission.entity.MissionCenterInfo;
import com.xd.core.mission.mapper.MissionCenterInfoMapper;
import com.xd.core.mission.service.IMissionCenterInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xd.core.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZX
 * @since 2025-03-09
 */
@Service
public class MissionCenterInfoServiceImpl extends ServiceImpl<MissionCenterInfoMapper, MissionCenterInfo> implements IMissionCenterInfoService {


    @Autowired
    private MissionCenterInfoMapper missionCenterInfoMapper;
    @Autowired
    private ISysUserService sysUserService;
    @Override
    public Page<MissionCenterInfo> exportCenter(PageQuery pageQuery) {
        PageHelper.startPage(pageQuery.getPageNum(), pageQuery.getPageSize()).setPageSizeZero(true);
        Integer userId = SecurityUtil.getLoginUserId();
        return missionCenterInfoMapper.exportCenter(SecurityUtil.getLoginCompanyId(),userId);
    }

    @Override
    public Page<MissionCenterInfo> importCenter(PageQuery pageQuery) {
        PageHelper.startPage(pageQuery.getPageNum(), pageQuery.getPageSize()).setPageSizeZero(true);
        Integer userId = SecurityUtil.getLoginUserId();
        return missionCenterInfoMapper.importCenter(SecurityUtil.getLoginCompanyId(),userId);
    }

}
